package com.situ.day25;

public class ThreadDemo {

    public static void main(String[] args) {
        MyThread myThread = new MyThread("MyThread");
        //不是启动线程，是普通方法调用
        //myThread.run();
        //启动线程
        myThread.start();

        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + " : " + i);
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main2(String[] args) {
        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable, "MyRunnable");
        thread.start();

//        LinkedList list = new LinkedList();
//        list.addFirst(1);
//        list.addLast(1);
//        list.removeFirst();
//        list.removeLast();
    }

}
